package com.ytz.controller;

import com.ytz.controller.dto.OrderInfoDTO;
import com.ytz.entity.OrderInfo;
import com.ytz.service.IOrderInfoService;
import com.ytz.service.impl.OrderInfoServiceImpl;
import com.ytz.vo.BaseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author ytz
 * @since 04-18
 */
@Controller
@RequestMapping("/api/order")
public class OrderInfoController {


    @Autowired
    private IOrderInfoService iOrderInfoService;

    @PostMapping("createOrder")
    public BaseResult createOrder(OrderInfoDTO orderInfoDTO) {
        OrderInfo order = iOrderInfoService.createOrder(orderInfoDTO);
        return BaseResult.ok(order);
    }

}
